<template>
  <div>
    <div class="ele-page-header">
      <div class="ele-page-title">系统基础配置</div>
      <div class="ele-page-desc"> 用于系统基础展示等场景。 </div>
    </div>
    <div class="ele-body"
         style="padding-bottom: 71px">
      <el-form ref="form"
               :model="form"
               :rules="rules"
               label-width="130px"
               @keyup.enter.native="submit"
               @submit.native.prevent>
        <el-card shadow="never"
                 header="平台配置"
                 body-style="padding: 22px 22px 0 22px;">
          <el-row :gutter="15">
            <el-col :lg="8"
                    :sm="12"
                    :xs="24">
              <el-form-item label="浏览器图标:"
                            prop="browserIcon">
                <span slot="label">
                  浏览器图标
                  <el-tooltip placement="top">
                    <div slot="content">
                      用于打开网站时浏览器标签页图标展示<br />
                      大小尺寸为100px * 100px
                    </div>
                    <i class="el-icon-question" />
                  </el-tooltip>
                </span>

                <div class="ele-image-upload-list">
                  <div class="ele-image-upload-item ele-image-upload-button"
                       @click="modalPicTap('dan', 'browser_logo', '浏览器图标')">
                    <div>
                      <div tabindex="0"
                           class="el-upload el-upload--text">
                        <div class="el-upload-dragger">
                          <i class="el-icon-plus ele-image-upload-icon"></i>
                        </div>

                        <div class="ele-image-upload-item"
                             style="margin: 0 0 0 0"
                             v-if="form.browser_logo">
                          <div class="el-image">
                            <img :src="form.browser_logo"
                                 width="100%"
                                 height="100%"
                                 class="el-image__inner"
                                 style="object-fit: cover" />
                          </div>
                          <div class="ele-image-upload-close"
                               @click="handleRemove('browser_logo')"><i class="el-icon-close"></i></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </el-form-item>
            </el-col>

            <el-col :lg="8"
                    :sm="12"
                    :xs="24">
              <el-form-item label="系统图标:"
                            prop="systemIcon">
                <span slot="label">
                  系统图标
                  <el-tooltip placement="top">
                    <div slot="content">
                      系统左侧LOGO展示<br />
                      大小尺寸为100px * 100px
                    </div>
                    <i class="el-icon-question" />
                  </el-tooltip>
                </span>
                <!-- <ele-image-upload v-model="form.systemIcon" :limit="1" :drag="true" :multiple="false"  @upload="onUpload" /> -->
                <div class="ele-image-upload-list">
                  <div class="ele-image-upload-item ele-image-upload-button"
                       @click="modalPicTap('dan', 'system_logo', '系统图标')">
                    <div>
                      <div tabindex="0"
                           class="el-upload el-upload--text">
                        <div class="el-upload-dragger">
                          <i class="el-icon-plus ele-image-upload-icon"></i>
                        </div>

                        <div class="ele-image-upload-item"
                             style="margin: 0 0 0 0"
                             v-if="form.system_logo">
                          <div class="el-image">
                            <img :src="form.system_logo"
                                 width="100%"
                                 height="100%"
                                 class="el-image__inner"
                                 style="object-fit: cover" />
                          </div>
                          <div class="ele-image-upload-close"
                               @click="handleRemove('system_logo')"><i class="el-icon-close"></i></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </el-form-item>
            </el-col>

            <el-col :lg="8"
                    :xs="24"
                    :sm="12">
              <el-form-item label="系统名字:"
                            label-width="130px"
                            prop="platform_name">
                <el-input v-model="form.platform_name"
                          placeholder="请输入该系统名字"
                          clearable></el-input>
              </el-form-item>
              <el-form-item label="备案号:"
                            label-width="130px"
                            prop="record_number">
                <el-input v-model="form.record_number"
                          placeholder="请输入备案号"
                          clearable></el-input>
              </el-form-item>
              <el-form-item label="京公网备案号:"
                            label-width="130px"
                            prop="network_record_number">
                <el-input v-model="form.network_record_number"
                          placeholder="请输入京公网备案号"
                          clearable></el-input>
              </el-form-item>
              <el-form-item label="版本号:"
                            label-width="130px"
                            prop="site_version">
                <el-input v-model="form.site_version"
                          :disabled="true"
                          placeholder="版本号"
                          clearable />
              </el-form-item>
              <el-form-item label="站点appid:"
                            label-width="130px"
                            prop="site_appid">
                <el-input v-model="form.site_appid"
                          placeholder="请输入站点appid"
                          clearable />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <el-card shadow="never"
                 header="LOGO配置"
                 body-style="padding: 22px 22px 0 22px;">
          <el-row :gutter="15">
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="登录背景图:"
                            prop="loginBackground">
                <span slot="label">
                  登录背景图
                  <el-tooltip placement="top">
                    <div slot="content">
                      用于登录时的背景图片选择<br />
                      大小尺寸跟分辨率同比例
                    </div>
                    <i class="el-icon-question" />
                  </el-tooltip>
                </span>
                <!--<ele-image-upload  v-model="form.loginBackground" :limit="1" :drag="true" :multiple="false"  @upload="onUpload" />-->
                <div class="ele-image-upload-list">
                  <div class="ele-image-upload-item ele-image-upload-button"
                       @click="
                      modalPicTap('dan', 'login_background_url', '登录背景图')
                    ">
                    <div>
                      <div tabindex="0"
                           class="el-upload el-upload--text">
                        <div class="el-upload-dragger">
                          <i class="el-icon-plus ele-image-upload-icon"></i>
                        </div>

                        <div class="ele-image-upload-item"
                             style="margin: 0 0 0 0"
                             v-if="form.login_background_url">
                          <div class="el-image">
                            <img :src="form.login_background_url"
                                 width="100%"
                                 height="100%"
                                 class="el-image__inner"
                                 style="object-fit: cover" />
                          </div>
                          <div class="ele-image-upload-close"
                               @click="handleRemove('login_background_url')"><i class="el-icon-close"></i></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </el-form-item>
            </el-col>

            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="登录左侧图标:"
                            prop="loginLeftIcon">
                <span slot="label">
                  登录左侧图标
                  <el-tooltip placement="top">
                    <div slot="content">
                      登录页左侧展示<br />
                      大小尺寸为510px * 420px
                    </div>
                    <i class="el-icon-question" />
                  </el-tooltip>
                </span>
                <!-- <ele-image-upload v-model="form.systemIcon" :limit="1" :drag="true" :multiple="false"  @upload="onUpload" /> -->
                <div class="ele-image-upload-list">
                  <div class="ele-image-upload-item ele-image-upload-button"
                       @click="
                      modalPicTap('dan', 'logo_img', '登录左侧图标')
                    ">
                    <div>
                      <div tabindex="0"
                           class="el-upload el-upload--text">
                        <div class="el-upload-dragger">
                          <i class="el-icon-plus ele-image-upload-icon"></i>
                        </div>

                        <div class="ele-image-upload-item"
                             style="margin: 0 0 0 0"
                             v-if="form.logo_img">
                          <div class="el-image">
                            <img :src="form.logo_img"
                                 width="100%"
                                 height="100%"
                                 class="el-image__inner"
                                 style="object-fit: cover" />
                          </div>
                          <div class="ele-image-upload-close"
                               @click="handleRemove('logo_img')"><i class="el-icon-close"></i></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </el-form-item>
            </el-col>
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="内部背景图:"
                            prop="loginLeftIcon">
                <span slot="label">
                  登录内部背景图
                  <el-tooltip placement="top">
                    <div slot="content">
                      登录页内部展示<br />
                      大小尺寸为510px * 420px
                    </div>
                    <i class="el-icon-question" />
                  </el-tooltip>
                </span>
                <!-- <ele-image-upload v-model="form.systemIcon" :limit="1" :drag="true" :multiple="false"  @upload="onUpload" /> -->
                <div class="ele-image-upload-list">
                  <div class="ele-image-upload-item ele-image-upload-button"
                       @click="
                      modalPicTap(
                        'dan',
                        'background_login_img',
                        '登录内部背景图'
                      )
                    ">
                    <div>
                      <div tabindex="0"
                           class="el-upload el-upload--text">
                        <div class="el-upload-dragger">
                          <i class="el-icon-plus ele-image-upload-icon"></i>
                        </div>

                        <div class="ele-image-upload-item"
                             style="margin: 0 0 0 0"
                             v-if="form.background_login_img">
                          <div class="el-image">
                            <img :src="form.background_login_img"
                                 width="100%"
                                 height="100%"
                                 class="el-image__inner"
                                 style="object-fit: cover" />
                          </div>
                          <div class="ele-image-upload-close"
                               @click="handleRemove('background_login_img')"><i class="el-icon-close"></i></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
        <el-card shadow="never"
                 header="基础配置"
                 body-style="padding: 22px 22px 0 22px;">
          <el-row :gutter="15">
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="搭子平台手续费"
                            prop="dazi_fees">
                <el-input v-model="form.dazi_fees"
                          type="number"
                          placeholder="请输入搭子完成平台手续费"
                          clearable><template slot="append">%</template></el-input>
              </el-form-item>
              <el-form-item label="服务平台手续费"
                            prop="service_fees">
                <el-input v-model="form.service_fees"
                          type="number"
                          placeholder="请输入服务完成平台手续费"
                          clearable><template slot="append">%</template></el-input>
              </el-form-item>

              <!-- <el-form-item label="社群平台手续费"
                            prop="community_fees">
                <el-input v-model="form.community_fees"
                          type="number"
                          placeholder="请输入社群完成平台手续费"
                          clearable><template slot="append">%</template></el-input>
              </el-form-item> -->
              <el-form-item label="搭子自己退出扣的手续费"
                            label-width="160px"
                            prop="dz_signout_rate ">
                <el-input v-model="form.dz_signout_rate"
                          type="number"
                          placeholder="请输入搭子自己退出扣的手续费"
                          clearable><template slot="append">%</template></el-input>
              </el-form-item>
              <el-form-item label="搭子置顶会员折扣(vip)"
                            label-width="160px"
                            prop="dazi_top_level_ratio  ">
                <el-input v-model="form.dazi_top_level_ratio "
                          type="number"
                          placeholder="请输入搭子置顶会员折扣(vip)"
                          clearable><template slot="append">%</template></el-input>
              </el-form-item>
              <el-form-item label="服务置顶会员折扣(vip)"
                            label-width="160px"
                            prop="service_top_level_ratio  ">
                <el-input v-model="form.service_top_level_ratio "
                          type="number"
                          placeholder="请输入服务置顶会员折扣(vip)"
                          clearable><template slot="append">%</template></el-input>
              </el-form-item>
            </el-col>
            <el-col :lg="8"
                    :sm="12"
                    class="flex-column">
              <el-form-item label="搭子是否需要审核"
                            prop="dazi_status">
                <el-switch active-value="1"
                           inactive-value="0"
                           v-model="form.dazi_status" />
              </el-form-item>
              <el-form-item label="服务是否需要审核"
                            prop="service_status">
                <el-switch v-model="form.service_status"
                           active-value="1"
                           inactive-value="0" />
              </el-form-item>
              <el-form-item label="圈子是否需要审核"
                            prop="circle_status">
                <el-switch v-model="form.circle_status"
                           active-value="1"
                           inactive-value="0" />
              </el-form-item>
              <el-form-item label="社群是否需要审核"
                            prop="community_status">
                <el-switch v-model="form.community_status"
                           active-value="1"
                           inactive-value="0" />
              </el-form-item>
              <el-form-item label="是否要认证实名"
                            prop="isOpen_idCard_authentication">
                <el-switch v-model="form.isOpen_idCard_authentication"
                           active-value="1"
                           inactive-value="0" />
              </el-form-item>
              <el-form-item label="搭子排序规则"
                            prop="dazi_sort_rule">
                <el-radio-group v-model="form.dazi_sort_rule">
                  <el-radio label="1">距离</el-radio>
                  <el-radio label="2">时间</el-radio>

                </el-radio-group>
              </el-form-item>

              <el-form-item label="服务排序规则"
                            prop="service_sort_rule">
                <el-radio-group v-model="form.service_sort_rule">
                  <el-radio label="1">距离</el-radio>
                  <el-radio label="2">时间</el-radio>

                </el-radio-group>
              </el-form-item>
              <el-form-item label="圈子排序规则"
                            prop="circle_sort_rule">
                <el-radio-group v-model="form.circle_sort_rule">
                  <el-radio label="1">距离</el-radio>
                  <el-radio label="2">时间</el-radio>

                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="搭子折扣（vip）"
                            prop="dazi_level_discount">
                <el-input v-model="form.dazi_level_discount"
                          placeholder="请输入vip用户搭子折扣"
                          clearable><template slot="append">%</template></el-input>
              </el-form-item>
              <el-form-item label="服务折扣（vip）"
                            prop="service_level_discount">
                <el-input v-model="form.service_level_discount"
                          type="number"
                          placeholder="请输入vip用户服务折扣"
                          clearable><template slot="append">%</template></el-input>
              </el-form-item>
              <el-form-item label="社群折扣（vip）"
                            prop="community_level_discount">
                <el-input v-model="form.community_level_discount"
                          type="number"
                          placeholder="请输入vip用户社群折扣"
                          clearable><template slot="append">%</template></el-input>
              </el-form-item>
            </el-col>

            <!-- <el-col :lg="8"
                    :sm="12">
              <el-form-item label="上班时间:"
                            prop="work_time">
                <el-input v-model="form.work_time"
                          placeholder="请输入上班时间描述"
                          clearable />
              </el-form-item>
            </el-col> -->
          </el-row>

          <el-row :gutter="15">
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="搭子发布数量"
                            label-width="150px"
                            prop="dazi_number">
                <el-input v-model="form.dazi_number"
                          type="number"
                          placeholder="请输入搭子发布数量"
                          clearable></el-input>
              </el-form-item>
              <el-form-item label="圈子发布数量"
                            label-width="150px"
                            prop="circle_number">
                <el-input v-model.number="form.circle_number"
                          type="number"
                          placeholder="请输入圈子发布数量"
                          clearable></el-input>
              </el-form-item>
              <el-form-item label="服务可发布数量"
                            label-width="160px"
                            prop="service_number">
                <el-input v-model.number="form.service_number"
                          type="number"
                          placeholder="请输入服务可发布数量"
                          clearable></el-input>
              </el-form-item>

              <!-- <el-form-item label="社群可发布数量"
                            prop="community_number">
                <el-input v-model="form.level_community_number"
                          type="number"
                          placeholder="请输入vip用户社群折扣"
                          clearable></el-input>
              </el-form-item> -->
              <!-- <el-form-item :label="'查看手机号('+configBS?.currency_name+')'"
                            prop="community_number">
                <el-input v-model="form.check_phone_price"
                          type="number"
                          :placeholder="'请输入查看手机号('+configBS?.currency_name+')'"
                          clearable></el-input>
              </el-form-item> -->
              <el-form-item label=" 搭子置顶数量"
                            prop="dazi_top_number">
                <el-input v-model="form.dazi_top_number"
                          type="number"
                          placeholder="请输入搭子置顶数量"
                          clearable></el-input>
              </el-form-item>
              <el-form-item label=" 搭子置顶价格"
                            prop="dazi_top_price">
                <el-input v-model="form.dazi_top_price"
                          type="number"
                          placeholder="请输入搭子置顶数量"
                          clearable><template slot="append">{{configBS?.currency_name}}</template></el-input>
              </el-form-item>
              <el-form-item label="服务置顶数量 "
                            prop="service_top_number">
                <el-input v-model="form.service_top_number"
                          type="number"
                          placeholder="请输入服务置顶数量"
                          clearable></el-input>
              </el-form-item>
              <el-form-item label=" 服务置顶价格"
                            prop="service_top_price">
                <el-input v-model="form.service_top_price"
                          type="number"
                          placeholder="请输入服务置顶价格"
                          clearable><template slot="append">{{configBS?.currency_name}}</template></el-input>
              </el-form-item>
              <el-form-item label="聊天价格折扣"
                            prop="service_top_price">
                <el-input v-model="form.chat_level_discount"
                          type="number"
                          placeholder="请输入聊天价格折扣"
                          clearable><template slot="append">%</template></el-input>
              </el-form-item>
              <el-form-item label="聊天价格"
                            prop="chat_price">
                <el-input v-model="form.chat_price"
                          type="number"
                          placeholder="请输入聊天价格"
                          clearable><template slot="append">{{configBS?.currency_name}}</template></el-input>
              </el-form-item>

              <el-form-item label="每日免费聊天次数"
                            prop="every_day_free_chat">
                <el-input v-model="form.every_day_free_chat"
                          type="number"
                          placeholder="请输入每天聊天次数"
                          clearable></el-input>
              </el-form-item>
              <el-form-item :label="'注册送('+configBS?.currency_name+')奖励'"
                            prop="register_send_coins">
                <el-input v-model="form.register_send_coins"
                          type="number"
                          placeholder="请输入注册送奖励"
                          clearable><template slot="append">{{ configBS?.currency_name }}</template></el-input>
              </el-form-item>
              <!-- <el-form-item :label="'推广新用户获取('+configBS?.currency_name+')奖励(直推)'"
                            prop="new_user_reward">
                <el-input v-model="form.new_user_reward"
                          type="number"
                          placeholder="请输入推广新用户获取奖励(直推)"
                          clearable></el-input>
              </el-form-item> -->
              <el-form-item :label="'推广新用户获取('+configBS?.currency_name+')奖励'"
                            prop="attend_register_send_coins">
                <el-input v-model="form.attend_register_send_coins"
                          type="number"
                          placeholder="请输入推广新用户获取奖励"
                          clearable><template slot="append">{{configBS?.currency_name}}</template></el-input>
              </el-form-item>
              <el-form-item :label="'实名认证送('+configBS?.currency_name+')'"
                            prop="idCard_number_authentication_send_coins">
                <el-input v-model="form.idCard_number_authentication_send_coins"
                          type="number"
                          placeholder="请输入实名认证送的奖励"
                          clearable><template slot="append">{{configBS?.currency_name}}</template></el-input>
              </el-form-item>
              <el-form-item :label="'填写资料送('+configBS?.currency_name+')'"
                            prop="fill_information_send_coins">
                <el-input v-model="form.fill_information_send_coins"
                          type="number"
                          placeholder="请输入填写资料认证送的奖励"
                          clearable><template slot="append">{{configBS?.currency_name}}</template></el-input>
              </el-form-item>
              <el-form-item :label="'手机号认证送('+configBS?.currency_name+')'"
                            prop="phone_number_authentication_send_coins">
                <el-input v-model="form.phone_number_authentication_send_coins"
                          type="number"
                          placeholder="请输入手机号认证送的奖励"
                          clearable><template slot="append">{{configBS?.currency_name}}</template></el-input>
              </el-form-item>

            </el-col>

            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="搭子发布数量(vip)"
                            prop="dazi_number">
                <el-input v-model="form.level_dazi_number"
                          placeholder="请输入vip搭子可发布数量"
                          clearable></el-input>
              </el-form-item>
              <el-form-item label="圈子发布数量(vip)"
                            prop="circle_number">
                <el-input v-model="form.level_circle_number"
                          type="number"
                          placeholder="请输入vip圈子可发布数量"
                          clearable></el-input>
              </el-form-item>
              <el-form-item label="服务可发布数量(vip)"
                            prop="service_number">
                <el-input v-model="form.level_service_number"
                          type="number"
                          placeholder="请输入vip服务可发布数量"
                          clearable></el-input>
              </el-form-item>

              <!-- <el-form-item label="社群可发布数量（vip）"
                            label-width="160px"
                            prop="community_number">
                <el-input v-model="form.community_number"
                          type="number"
                          placeholder="请输入vip用户社群折扣"
                          clearable></el-input>
              </el-form-item> -->
              <el-form-item label="小程序登录名字"
                            label-width="160px"
                            prop="service_automatic_balance_time">
                <el-input v-model="form.service_automatic_balance_time"
                          placeholder="请输入微信登录名字"
                          clearable></el-input>
              </el-form-item>
              <el-form-item label="申请合伙人费用"
                            label-width="160px"
                            prop="apply_associate_fee">
                <el-input v-model="form.apply_associate_fee"
                          type="number"
                          placeholder="请输入申请合伙人费用"
                          clearable><template slot="append">元</template></el-input>
              </el-form-item>

            </el-col>
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="腾讯地图Key"
                            label-width="150px"
                            prop="tencent_map_key">
                <el-input v-model="form.tencent_map_key"
                          placeholder="请输入腾讯地图Key"
                          clearable></el-input>
              </el-form-item>
              <el-form-item label="本地证书"
                            label-width="150px"
                            prop="local_cert">
                <el-input v-model="form.local_cert"
                          placeholder="请输入本地证书"
                          clearable></el-input>
                <div style="color: #999">例如(绝对路径):/www/server/panel/vhost/cert/dazi.weijuyunke.cn/fullchain.pem</div>
              </el-form-item>
              <el-form-item label="local_pk"
                            label-width="150px"
                            prop="local_pk">
                <el-input v-model="form.local_pk"
                          placeholder="请输入local_pk"
                          clearable></el-input>

                <div style="color: #999">例如(绝对路径):/www/server/panel/vhost/cert/dazi.weijuyunke.cn/privkey.pem</div>
              </el-form-item>

              <el-form-item label="流量主id"
                            prop="advertisement_id">
                <el-input v-model="form.advertisement_id"
                          placeholder="请输入流量主id"
                          clearable />
              </el-form-item>
              <el-form-item label="实名认证最小年龄"
                            label-width="160px"
                            prop="min_idenauthen_age">
                <el-input v-model="form.min_idenauthen_age"
                          type="number"
                          placeholder="请输入实名最小年龄"
                          clearable></el-input>
              </el-form-item>
              <el-form-item label="平台货币名称"
                            prop="currency_name">
                <el-input v-model="form.currency_name"
                          placeholder="请输入平台货币名称"
                          clearable />
              </el-form-item>
              <!-- <el-form-item label="小程序登录名称"
                            prop="service_automatic_balance_time">
                <el-input v-model="form.service_automatic_balance_time"
                          placeholder="请输入小程序登录名称"
                          clearable />
              </el-form-item> -->

              <el-form-item label="平台货币图片:"
                            prop="distribution_poster">
                <!--<ele-image-upload v-model="form.serviceQrCode" :limit="1" :drag="true" :multiple="false"  @upload="onUpload" />-->
                <div class="ele-image-upload-list">
                  <div class="ele-image-upload-item ele-image-upload-button"
                       @click="modalPicTap('dan', 'currency_img', '分享图片')">
                    <div>
                      <div tabindex="0"
                           class="el-upload el-upload--text">
                        <div class="el-upload-dragger">
                          <i class="el-icon-plus ele-image-upload-icon"></i>
                        </div>

                        <div class="ele-image-upload-item"
                             style="margin: 0 0 0 0"
                             v-if="form.currency_img">
                          <div class="el-image">
                            <img :src="form.currency_img"
                                 width="100%"
                                 height="100%"
                                 class="el-image__inner"
                                 style="object-fit: cover" />
                          </div>
                          <div class="ele-image-upload-close"
                               @click="handleRemove('currency_img')"><i class="el-icon-close"></i></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </el-form-item>
              <el-form-item label="拉新海报:"
                            prop="distribution_poster">
                <span slot="label">
                  拉新海报
                  <el-tooltip placement="top">
                    <div slot="content">
                      建议尺寸为650*812px<br />

                    </div>
                    <i class="el-icon-question" />
                  </el-tooltip>
                </span>
                <!--<ele-image-upload v-model="form.serviceQrCode" :limit="1" :drag="true" :multiple="false"  @upload="onUpload" />-->
                <div class="ele-image-upload-list">
                  <div class="ele-image-upload-item ele-image-upload-button"
                       @click="modalPicTap('dan', 'invite_img', '分享图片')">
                    <div>
                      <div tabindex="0"
                           class="el-upload el-upload--text">
                        <div class="el-upload-dragger">
                          <i class="el-icon-plus ele-image-upload-icon"></i>
                        </div>

                        <div class="ele-image-upload-item"
                             style="margin: 0 0 0 0"
                             v-if="form.invite_img">
                          <div class="el-image">
                            <img :src="form.invite_img"
                                 width="100%"
                                 height="100%"
                                 class="el-image__inner"
                                 style="object-fit: cover" />
                          </div>
                          <div class="ele-image-upload-close"
                               @click="handleRemove('invite_img')"><i class="el-icon-close"></i></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
        <el-card shadow="never"
                 header="图片审核"
                 body-style="padding: 22px 22px 0 22px;">
          <el-row :gutter="15">

            <el-col :lg="10"
                    :md="8">
              <el-form-item label="七牛云accessKey"
                            label-width="160px"
                            prop="qiniuyun_accessKey">
                <el-input v-model="form.qiniuyun_accessKey"
                          placeholder="用于图片审核"
                          clearable />
              </el-form-item>
            </el-col>
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="七牛云secretKey"
                            label-width="160px"
                            prop="qiniuyun_secretKey">
                <el-input v-model="form.qiniuyun_secretKey"
                          show-password
                          placeholder="用于图片审核"
                          clearable />
              </el-form-item>
            </el-col>

          </el-row>
        </el-card>
        <el-card shadow="never"
                 header="客服配置"
                 body-style="padding: 22px 22px 0 22px;">
          <el-row :gutter="15">
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="客服二维码:"
                            prop="serviceQrCode">
                <!--<ele-image-upload v-model="form.serviceQrCode" :limit="1" :drag="true" :multiple="false"  @upload="onUpload" />-->
                <div class="ele-image-upload-list">
                  <div class="ele-image-upload-item ele-image-upload-button"
                       @click="modalPicTap('dan', 'customer_qr', '客服二维码')">
                    <div>
                      <div tabindex="0"
                           class="el-upload el-upload--text">
                        <div class="el-upload-dragger">
                          <i class="el-icon-plus ele-image-upload-icon"></i>
                        </div>

                        <div class="ele-image-upload-item"
                             style="margin: 0 0 0 0"
                             v-if="form.customer_qr">
                          <div class="el-image">
                            <img :src="form.customer_qr"
                                 width="100%"
                                 height="100%"
                                 class="el-image__inner"
                                 style="object-fit: cover" />
                          </div>
                          <div class="ele-image-upload-close"
                               @click="handleRemove('customer_qr')"><i class="el-icon-close"></i></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </el-form-item>
            </el-col>
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="小程序/公众号联系客服电话"
                            prop="customer_service">
                <el-input maxlength="11"
                          v-model="form.customer_service"
                          placeholder="请输入手机号"
                          clearable />
              </el-form-item>
            </el-col>
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="平台电话"
                            prop="platform_phone">
                <el-input maxlength="11"
                          v-model="form.platform_phone"
                          placeholder="请输入平台电话"
                          clearable />
              </el-form-item>
            </el-col>

            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="邮箱:"
                            prop="platform_email">
                <el-input v-model="form.platform_email"
                          placeholder="请输入"
                          clearable>
                  <template v-slot:append>.com</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="地址:"
                            prop="platform_address">
                <el-input v-model="form.platform_address"
                          placeholder="请输入地址"
                          @focus="selPosition"
                          clearable />
              </el-form-item>
            </el-col>
            <!-- <el-col :lg="8"
                    :sm="12">
              <el-form-item label="上班时间:"
                            prop="work_time">
                <el-input v-model="form.work_time"
                          placeholder="请输入上班时间描述"
                          clearable />
              </el-form-item>
            </el-col> -->
          </el-row>
        </el-card>
        <el-card shadow="never"
                 header="分享图片"
                 body-style="padding: 22px 22px 0 22px;">
          <el-row :gutter="15">
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="分享图片(搭子):"
                            prop="distribution_poster">
                <!--<ele-image-upload v-model="form.serviceQrCode" :limit="1" :drag="true" :multiple="false"  @upload="onUpload" />-->
                <div class="ele-image-upload-list">
                  <div class="ele-image-upload-item ele-image-upload-button"
                       @click="
                      modalPicTap('dan', 'distribution_poster', '分享图片')
                    ">
                    <div>
                      <div tabindex="0"
                           class="el-upload el-upload--text">
                        <div class="el-upload-dragger">
                          <i class="el-icon-plus ele-image-upload-icon"></i>
                        </div>

                        <div class="ele-image-upload-item"
                             style="margin: 0 0 0 0"
                             v-if="form.distribution_poster">
                          <div class="el-image">
                            <img :src="form.distribution_poster"
                                 width="100%"
                                 height="100%"
                                 class="el-image__inner"
                                 style="object-fit: cover" />
                          </div>
                          <div class="ele-image-upload-close"
                               @click="handleRemove('distribution_poster')"><i class="el-icon-close"></i></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </el-form-item>
            </el-col>
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="分享标题(搭子)"
                            prop="distribution_title">
                <el-input v-model="form.distribution_title"
                          placeholder="请输入分享标题(搭子)"
                          clearable />
              </el-form-item>
            </el-col>
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="分享描述(搭子)"
                            prop="distribution_instructions">
                <el-input v-model="form.distribution_instructions"
                          placeholder="请输入分享描述(搭子)"
                          clearable />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="15">
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="分享图片(圈子):"
                            prop="coterie_distribution_poster">
                <!--<ele-image-upload v-model="form.serviceQrCode" :limit="1" :drag="true" :multiple="false"  @upload="onUpload" />-->
                <div class="ele-image-upload-list">
                  <div class="ele-image-upload-item ele-image-upload-button"
                       @click="
                      modalPicTap('dan', 'coterie_distribution_poster', '分享图片')
                    ">
                    <div>
                      <div tabindex="0"
                           class="el-upload el-upload--text">
                        <div class="el-upload-dragger">
                          <i class="el-icon-plus ele-image-upload-icon"></i>
                        </div>

                        <div class="ele-image-upload-item"
                             style="margin: 0 0 0 0"
                             v-if="form.coterie_distribution_poster">
                          <div class="el-image">
                            <img :src="form.coterie_distribution_poster"
                                 width="100%"
                                 height="100%"
                                 class="el-image__inner"
                                 style="object-fit: cover" />
                          </div>
                          <div class="ele-image-upload-close"
                               @click="handleRemove('coterie_distribution_poster')"><i class="el-icon-close"></i></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </el-form-item>
            </el-col>
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="分享标题(圈子)"
                            prop="coterie_distribution_title">
                <el-input v-model="form.coterie_distribution_title"
                          placeholder="请输入分享标题(圈子)"
                          clearable />
              </el-form-item>
            </el-col>
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="分享描述(圈子)"
                            prop="coterie_distribution_instructions">
                <el-input v-model="form.coterie_distribution_instructions"
                          placeholder="请输入分享描述(圈子)"
                          clearable />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="15">
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="分享图片(服务):"
                            prop="service_distribution_poster">
                <!--<ele-image-upload v-model="form.serviceQrCode" :limit="1" :drag="true" :multiple="false"  @upload="onUpload" />-->
                <div class="ele-image-upload-list">
                  <div class="ele-image-upload-item ele-image-upload-button"
                       @click="
                      modalPicTap('dan', 'service_distribution_poster', '分享图片')
                    ">
                    <div>
                      <div tabindex="0"
                           class="el-upload el-upload--text">
                        <div class="el-upload-dragger">
                          <i class="el-icon-plus ele-image-upload-icon"></i>
                        </div>

                        <div class="ele-image-upload-item"
                             style="margin: 0 0 0 0"
                             v-if="form.service_distribution_poster">
                          <div class="el-image">
                            <img :src="form.service_distribution_poster"
                                 width="100%"
                                 height="100%"
                                 class="el-image__inner"
                                 style="object-fit: cover" />
                          </div>
                          <div class="ele-image-upload-close"
                               @click="handleRemove('service_distribution_poster')"><i class="el-icon-close"></i></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </el-form-item>
            </el-col>
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="分享标题(服务)"
                            prop="service_distribution_title">
                <el-input v-model="form.service_distribution_title"
                          placeholder="请输入分享标题(服务)"
                          clearable />
              </el-form-item>
            </el-col>
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="分享描述(服务)"
                            prop="service_distribution_instructions">
                <el-input v-model="form.service_distribution_instructions"
                          placeholder="请输入分享描述(服务)"
                          clearable />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="15">
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="分享图片(社交):"
                            prop="social_distribution_poster">
                <!--<ele-image-upload v-model="form.serviceQrCode" :limit="1" :drag="true" :multiple="false"  @upload="onUpload" />-->
                <div class="ele-image-upload-list">
                  <div class="ele-image-upload-item ele-image-upload-button"
                       @click="
                      modalPicTap('dan', 'social_distribution_poster', '分享图片')
                    ">
                    <div>
                      <div tabindex="0"
                           class="el-upload el-upload--text">
                        <div class="el-upload-dragger">
                          <i class="el-icon-plus ele-image-upload-icon"></i>
                        </div>

                        <div class="ele-image-upload-item"
                             style="margin: 0 0 0 0"
                             v-if="form.social_distribution_poster">
                          <div class="el-image">
                            <img :src="form.social_distribution_poster"
                                 width="100%"
                                 height="100%"
                                 class="el-image__inner"
                                 style="object-fit: cover" />
                          </div>
                          <div class="ele-image-upload-close"
                               @click="handleRemove('social_distribution_poster')"><i class="el-icon-close"></i></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </el-form-item>
            </el-col>
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="分享标题(社交)"
                            prop="social_distribution_title">
                <el-input v-model="form.social_distribution_title"
                          placeholder="请输入分享标题(社交)"
                          clearable />
              </el-form-item>
            </el-col>
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="分享描述(社交)"
                            prop="social_distribution_instructions">
                <el-input v-model="form.social_distribution_instructions"
                          placeholder="请输入分享描述(社交)"
                          clearable />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="15">
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="分享图片(社群):"
                            prop="community_distribution_poster">
                <!--<ele-image-upload v-model="form.serviceQrCode" :limit="1" :drag="true" :multiple="false"  @upload="onUpload" />-->
                <div class="ele-image-upload-list">
                  <div class="ele-image-upload-item ele-image-upload-button"
                       @click="
                      modalPicTap('dan', 'community_distribution_poster', '分享图片')
                    ">
                    <div>
                      <div tabindex="0"
                           class="el-upload el-upload--text">
                        <div class="el-upload-dragger">
                          <i class="el-icon-plus ele-image-upload-icon"></i>
                        </div>

                        <div class="ele-image-upload-item"
                             style="margin: 0 0 0 0"
                             v-if="form.community_distribution_poster">
                          <div class="el-image">
                            <img :src="form.community_distribution_poster"
                                 width="100%"
                                 height="100%"
                                 class="el-image__inner"
                                 style="object-fit: cover" />
                          </div>
                          <div class="ele-image-upload-close"
                               @click="handleRemove('community_distribution_poster')"><i class="el-icon-close"></i></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </el-form-item>
            </el-col>
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="分享标题(社群)"
                            prop="community_distribution_title">
                <el-input v-model="form.community_distribution_title"
                          placeholder="请输入分享标题(社群)"
                          clearable />
              </el-form-item>
            </el-col>
            <el-col :lg="10"
                    :md="8">
              <el-form-item label="分享描述(社群)"
                            prop="community_distribution_instructions">
                <el-input v-model="form.community_distribution_instructions"
                          placeholder="请输入分享描述(社群)"
                          clearable />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
        <el-card shadow="never"
                 header="公众号/小程序基础配置"
                 body-style="padding: 22px 22px 0 22px;">
          <el-row :gutter="15">
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="用户注册协议:"
                            prop="transaction_rule">
                <tinymce-editor ref="editorRef"
                                :init="editorConfig"
                                v-model="form.register_notice" />
              </el-form-item>
            </el-col>
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="会员开通描述:"
                            prop="transaction_rule">
                <tinymce-editor ref="editorRef"
                                :init="editorConfig"
                                v-model="form.level_desc" />
              </el-form-item>
            </el-col>

            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="开通会员协议:"
                            prop="transaction_rule">
                <tinymce-editor ref="editorRef"
                                :init="editorConfig"
                                v-model="form.user_agreement" />
              </el-form-item>
            </el-col>
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="充值协议:"
                            prop="transaction_rule">
                <tinymce-editor ref="editorRef"
                                :init="editorConfig"
                                v-model="form.recharge_amount" />
              </el-form-item>
            </el-col>
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="合伙人推广说明:"
                            prop="transaction_rule">
                <tinymce-editor ref="editorRef"
                                :init="editorConfig"
                                v-model="form.associate_desc" />
              </el-form-item>
            </el-col>
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="合伙人服务协议:"
                            prop="transaction_rule">
                <tinymce-editor ref="editorRef"
                                :init="editorConfig"
                                v-model="form.associate_service_agreement" />
              </el-form-item>
            </el-col>
            <el-col :lg="8"
                    :sm="12">
              <el-form-item label="合伙人说明:"
                            prop="transaction_rule">
                <tinymce-editor ref="editorRef"
                                :init="editorConfig"
                                v-model="form.distribution_text" />
              </el-form-item>
            </el-col>

          </el-row>
        </el-card>

        <!--上传图片组件-->
        <uploadPictures ref="upload"
                        :isChoice="isChoice"
                        :visible.sync="modalPic"
                        @getPic="getPic"
                        :gridBtn="gridBtn"
                        :gridPic="gridPic"
                        :title="modalTitle"></uploadPictures>

        <!-- 底部工具栏 -->
        <div class="ele-bottom-tool">
          <div v-if="validMsg"
               class="ele-text-danger">
            <i class="el-icon-circle-close"></i>
            <span>{{ validMsg }}</span>
          </div>
          <div class="ele-bottom-tool-actions">
            <el-button type="primary"
                       :loading="loading"
                       @click="submit">
              提交
            </el-button>
          </div>
        </div>
      </el-form>
      <position ref="pos"
                @chooseMapPoint="getCallMap"
                @cancel="cancelMap"
                @sure="sure"></position>
    </div>
  </div>
</template>
<script>
import position from './components/map';
import TinymceEditor from '@/components/TinymceEditor/index.vue';
import { config, configEdit } from '@/api/config/index';
import uploadPictures from './components/uploadImg';
import { upload } from '@/api/saveImg/index';
// import EleImageUpload from 'ele-admin/es/ele-image-upload';
import request from '@/utils/request';
export default {
  name: 'FormAdvanced',
  components: { uploadPictures, position, TinymceEditor },
  data () {
    return {
      editorConfig: {
        height: 525,
        relative_urls: false,
        convert_urls: false,

        images_upload_handler: async (blobInfo, success) => {
          //  ==================================

          const files = blobInfo.blob();
          // 使用 axios 上传，实际开发这段建议写在 api 中再调用 api
          const param = new FormData();

          param.append('file', files, files.name);

          const res = await upload(param);
          console.log(res.data.url);

          success(res.data.url);

          // });
        }
      },
      // 复选框
      checkList: ['D音H5任务发布'],
      // 能力名称——能力选择——复选框
      checkSelList: [],
      modalTitle: '',
      modalPic: false,
      isChoice: '单选',

      gridBtn: {
        xl: 4,
        lg: 8,
        md: 8,
        sm: 8,
        xs: 8
      },
      gridPic: {
        xl: 6,
        lg: 8,
        md: 12,
        sm: 12,
        xs: 12
      },
      // 表单提交状态
      loading: false,
      configBS: JSON.parse(localStorage.getItem('config')),

      // 表单数据
      form: {
        apply_associate_fee: '',
        // 是否要认证实名
        isOpen_idCard_authentication: '',
        associate_service_agreement: '',
        qiniuyun_secretKey: '',
        qiniuyun_accessKey: '',
        circle_sort_rule: '',
        dimension: '',
        longitude: '',
        // check_phone_level_ratio: '',
        service_automatic_balance_time: '',
        dazi_sort_rule: 1,
        service_sort_rule: 1,
        // 服务置顶价格
        service_top_price: '',
        // 服务置顶数量
        service_top_number: '',
        // 搭子置顶价格
        dazi_top_price: '',
        // 搭子置顶数量
        dazi_top_number: '',
        // check_phone_price: '',
        // 浏览器图标
        browser_logo: '',
        dazi_top_level_ratio: '',
        service_top_level_ratio: '',
        // 系统图标
        system_logo: '',
        // 备案号
        record_number: '',
        chat_level_discount: '',
        chat_price: '',
        every_day_free_chat: '',

        // new_user_reward: '',
        // 京公网备案号
        network_record_number: '',
        // 版权信息
        site_version: '',
        // 登录背景图
        login_background_url: '',
        //登录左侧图标
        logo_img: '',
        //客服二维码
        customer_qr: '',
        currency_name: '',
        // 手机号
        phone: '',
        // 邮箱
        platform_email: '',
        // 地址
        platform_address: '',
        // 平台电话
        advertisement_id: '',
        customer_service: '',
        platform_phone: '',
        // 搭子完成平台手续费
        dazi_fees: '',
        // 服务完成平台手续费
        service_fees: '',
        // 腾讯地图Key
        tencent_map_key: '',
        // 本地证书
        local_cert: '',
        local_pk: '',
        register_notice: '',

        // community_fees: '', 

        // 搭子状态
        dazi_status: '',

        // 服务状态
        service_status: '',
        // 圈子状态
        circle_status: '',
        // 社群状态
        community_status: '',
        service_level_discount: '',
        dazi_level_discount: '',
        community_level_discount: '',

        // 上班时间
        work_time: '',
        // 版本号

        // 系统名字

        platform_name: '',
        //  公众号二维码
        gongzonghao_qr_code: '',
        // 公众号图片
        gongzonghao_icon: '',
        // 技术支持
        skill_name: '',
        // 交易规则
        transaction_rule: '',
        // 收银名称
        cashier_name: '',
        // 分享标题
        distribution_title: '',
        // 分享海报
        distribution_instructions: '',
        // 分享海报
        distribution_poster: '',
        // 平台货币名字,
        currency_img: '',
        invite_img: '',

        // 站点appid
        site_appid: '',
        // 登录内部背景图
        background_login_img: '',
        // // 搭子数量
        dazi_number: '',
        // 圈子数量
        circle_number: '',
        // 服务数量
        service_number: '',
        // 社群数量
        // community_number: '',

        level_dazi_number: '',
        // 圈子数量
        level_circle_number: '',
        // 服务数量
        level_service_number: '',
        // 社群数量
        level_community_number: '',
        // 充值协议
        recharge_amount: '',
        user_agreement: '',
        level_desc: '',
        dz_signout_rate: '',
        // 服务描述
        service_distribution_instructions: '',
        // 服务海报
        service_distribution_poster: '',
        // 服务标题
        service_distribution_title: '',

        // 圈子描述
        coterie_distribution_instructions: '',
        // 圈子海报
        coterie_distribution_poster: '',
        // 圈子标题
        coterie_distribution_title: '',

        // 社交描述
        social_distribution_instructions: '',
        // 社交海报
        social_distribution_poster: '',
        // 社交标题
        social_distribution_title: '',

        // 社群描述
        community_distribution_instructions: '',
        // 社群海报
        community_distribution_poster: '',
        // 社群标题
        community_distribution_title: '',
        // 实名认证最小年龄
        min_idenauthen_age: '',
        // 注册送奖励
        register_send_coins: '',
        // 拉新送(未成为分销员)
        attend_register_send_coins: '',
        // 实名送
        idCard_number_authentication_send_coins: '',
        // 手机号送
        phone_number_authentication_send_coins: '',
        // 填写资料送
        fill_information_send_coins: '',
        // 推广说明
        associate_desc: '',
        // 合伙人说明
        distribution_text: '',

      },
      isUpdata: false,
      // 表单验证规则
      rules: {
        name: [
          {
            required: true,
            message: '请输入仓库名',
            trigger: 'blur'
          }
        ],
        url: [
          {
            required: true,
            message: '请输入仓库域名',
            trigger: 'blur'
          }
        ],
        datetime: [
          {
            required: true,
            message: '请选择生效日期',
            trigger: 'blur'
          }
        ],
        administrator: [
          {
            required: true,
            message: '请选择仓库管理员',
            trigger: 'blur'
          }
        ],
        approver: [
          {
            required: true,
            message: '请选择审批人',
            trigger: 'blur'
          }
        ],
        type: [
          {
            required: true,
            message: '请选择仓库类型',
            trigger: 'blur'
          }
        ],
        task: [
          {
            required: true,
            message: '请输入任务名',
            trigger: 'blur'
          }
        ],
        description: [
          {
            required: true,
            message: '请输入任务表述',
            trigger: 'blur'
          }
        ],
        executor: [
          {
            required: true,
            message: '请选择执行人',
            trigger: 'blur'
          }
        ],
        officer: [
          {
            required: true,
            message: '请选择责任人',
            trigger: 'blur'
          }
        ],
        reminder: [
          {
            required: true,
            message: '请选择提醒时间',
            trigger: 'blur'
          }
        ],
        taskType: [
          {
            required: true,
            message: '请选择任务类型',
            trigger: 'blur'
          }
        ]
      },
      // 表单验证信息
      validMsg: '',
      checkAll: [],
      checkSelAll: [],
      dialog: false
    };
  },
  mounted () {
    this.querys();
  },
  methods: {
    mapTx () {
      this.dialog = true;
    },
    querys () {
      // 查询回显
      config()
        .then((msg) => {
          console.log('这个是vuex里面的siteId');
          if (msg) {
            //   是修改
            this.$util.assignObject(this.form, {
              ...msg.data
            });

            console.log(this.$refs['pos'] + '===========ces1');

            this.isUpdata = true;
          } else {
            // 修改
            this.isUpdata = false;
          }
        })
        .catch((e) => {
          this.$message.error(e.message);
        });
    },

    // 调用
    selPosition () {
      this.$nextTick(() => {
        console.log(this.$refs['pos']);
        if (this.isUpdata) {
          this.$refs['pos'].show(this.form);
        } else {
          this.$refs['pos'].show();
        } // 视频号二维码展示
      });
    },
    sure (e) {
      // console.log(e);
      console.log(e);
      this.form.longitude = e.lng;
      this.form.dimension = e.lat;
      this.form.platform_address = e.address;
    },
    // 地图 取消
    cancelMap () {
      this.visibleMap = false;
    },
    checkClick (e) {
      console.log('e=====', e);
      this.checkAll = e;
    },
    checkSelClick (e) {
      console.log('e=====', e);
      this.checkSelAll = e;
    },
    // 选择图片
    modalPicTap (tit, picTit, openTitle) {
      this.modalTitle = openTitle;
      this.isChoice = tit === 'dan' ? '单选' : '多选';
      this.picTit = picTit;
      this.modalPic = true;
      this.$nextTick(() => {
        this.$refs['upload'].show();
      });
    },
    // 选中图片
    getPic (pc) {
      console.log('pc========', pc);
      switch (this.picTit) {
        case 'browser_logo':
          this.form.browser_logo = pc.img;
          break;
        case 'system_logo':
          this.form.system_logo = pc.img;
          break;
        case 'login_background_url':
          this.form.login_background_url = pc.img;
          break;
        case 'logo_img':
          this.form.logo_img = pc.img;
          break;
        case 'customer_qr':
          this.form.customer_qr = pc.img;
          break;
        case 'gongzonghao_icon':
          this.form.gongzonghao_icon = pc.img;
          break;
        case 'gongzonghao_qr_code':
          this.form.gongzonghao_qr_code = pc.img;
          break;
        case 'distribution_poster':
          this.form.distribution_poster = pc.img;
          break;
        case 'background_login_img':
          this.form.background_login_img = pc.img;
          break;
        case 'coterie_distribution_poster':
          this.form.coterie_distribution_poster = pc.img;
          break;
        case 'service_distribution_poster':
          this.form.service_distribution_poster = pc.img;
          break;
        case 'community_distribution_poster':
          this.form.community_distribution_poster = pc.img;
          break;
        case 'social_distribution_poster':
          this.form.social_distribution_poster = pc.img;
          break;
        case 'currency_img':
          this.form.currency_img = pc.img;
          break;
        case 'invite_img':
          this.form.invite_img = pc.img;
          break;

      }
      this.modalPic = false;
    },
    //删除图片
    handleRemove (field) {
      this.form[field] = '';
    },
    /* 表单提交 */
    submit () {
      this.$refs['form'].validate((valid, obj) => {
        if (valid) {
          console.log(this.form);
          // 手机号验证
          if (
            this.form.platform_phone &&
            this.$sun.checkModbile(this.form.platform_phone) == false
          ) {
            this.$message.error('手机号码格式不正确！');
            return;
          }
          // 邮箱验证
          if (
            this.form.platform_email &&
            this.$sun.checkEmail(this.form.platform_email + '.com') == false
          ) {
            this.$message.error('邮箱格式不正确！');
            return;
          }

          this.validMsg = '';
          this.loading = true;

          const data = {
            ...this.form
          };

          configEdit(data)
            .then(() => {
              localStorage.setItem('config', JSON.stringify(data));
              this.loading = false;
              // id 不存在则调用查询是否已保存，否则保存多次都会不传id
              // if(!this.form.id){
              this.querys();
              // }
              this.$message.success('提交成功！');
            })
            .catch((e) => {
              this.loading = false;
              this.$message.error(e.message);
            });
        } else {
          this.validMsg = ` 共有校验 ${Object.keys(obj).length} 项不通过`;
          return false;
        }
      });
    },
    onUpload (item) {
      console.log('item:', item);
      item.status = 'uploading';
      const formData = new FormData();
      formData.append('file', item.file);
      request({
        url: '/common/uploadFile',
        method: 'post',
        data: formData,
        onUploadProgress: (e) => {
          // 文件上传进度回调
          if (e.lengthComputable) {
            item.progress = (e.loaded / e.total) * 100;
          }
        }
      })
        .then((res) => {
          if (res.data.code === 0) {
            item.status = 'done';
            item.url = res.data.data.url;
            // 如果你上传的不是图片格式, 建议将 url 字段作为缩略图, 再添加其它字段作为最后提交数据
            //item.url = res.data.data.thumbnail;  // 也可以不赋值 url 字段, 默认会显示为一个文件图标
            item.fileUrl = res.data.data.url;
          }
        })
        .catch(() => {
          item.status = 'exception';
        });
    }
  }
};
</script>
<style lang="less" scoped>
/deep/.ele-bottom-tool-actions {
  text-align: center;
}
</style>
